<?php

namespace App\Http\Controllers\Mini;

use App\Http\Controllers\Controller;
use App\Models\StudentModel;
use Illuminate\Http\Request;

class StudentController extends Controller
{
    public function search(Request $request) {
        $students = StudentModel::where('company_id', $request->teacherInfo->company_id)
        ->where("name", "like", $request->studentName.'%')
        ->limit(5)
        ->get();
        return self::ok($students);
    }
}
